def protect(**arg):
    def decorator(meth):
        if 'term' in arg:
            print arg['term']
        print ' I am decorator '
        def func(iself, *x):
            print ' I am func '
            return meth(x)
        return func
    return decorator


@protect(term='test')
def bar(x):
    print ' I am the bar ' + x
bar('12')



